package Io;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 666
 * Date: 2023-04-05
 * Time: 16:38
 */
public class test5 {
    public static void main(String[] args) throws IOException {
        try(OutputStream os = new FileOutputStream("output.txt")){
         //   String s="nothing";
            String s= "你好中国";
            byte[] buf=s.getBytes("UTF-8");
            os.write(buf);
        //    byte[] buf  = new byte[]{(byte)'G',(byte) 'O',(byte) 'O',(byte) 'd'};
//os.write(buf,0,2);
os.flush();
        }
    }
}
